package personal.xjl._23java1studentdemo.spring;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OxCart {
    @Autowired
    private Cow cow;
    @Value("3")
    private int wheelCount;

    public void run() {
        System.out.println("牛车（" + cow.getName() + " 拉的）正在行驶");
    }
}